package by.dvrudenko.avtobaza.webapp.utils.renderer;

import org.apache.wicket.markup.html.form.IChoiceRenderer;

import by.dvrudenko.avtobaza.datamodel.Driver;
import by.dvrudenko.avtobaza.datamodel.UserOrder;

public class UserOrderChoiseRenderer implements IChoiceRenderer<UserOrder> {

	public static UserOrderChoiseRenderer INSTANCE = new UserOrderChoiseRenderer();

	private UserOrderChoiseRenderer() {
		super();
	}

	@Override
	public Object getDisplayValue(UserOrder userOrder) {
		return userOrder.getCargoBeginningCity().getCityName() + "-" + userOrder.getCargoFinalCity().getCityName();
	}

	@Override
	public String getIdValue(UserOrder userOrder, int index) {
		return userOrder.getId().toString();
	}

}
